import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/login",
      name: "login",
      component: () => import("../views/LoginView.vue"),
    },
    {
      path: "/",
      name: "home",
      component: HomeView,
      redirect: { name: "index" },
      children: [
        {
          path: "index",
          name: "index",
          component: () => import("../views/IndexView.vue"),
        },
        {
          path: "about",
          name: "about",
          component: () => import("../views/AboutView.vue"),
        },
        {
          path: "table",
          name: "table",
          component: () => import("../views/TableView.vue"),
        },
        {
          path: "form",
          name: "form",
          component: () => import("../views/FormView.vue"),
        },
        {
          path: "echarts",
          name: "echarts",
          component: () => import("../views/EchartsView.vue"),
        },
        {
          path: "edit",
          name: "edit",
          component: () => import("../views/EditView.vue"),
        },
        {
          path: "image",
          name: "image",
          component: () => import("../views/ImageView.vue"),
        },
      ],
    },
  ],
});

export default router;
